
    var PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\n" +
        "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDfw1/P15GQzGGYvNwVmXIGGxea\n" +
        "8Pb2wJcF7ZW7tmFdLSjOItn9kvUsbQgS5yxx+f2sAv1ocxbPTsFdRc6yUTJdeQol\n" +
        "DOkEzNP0B8XKm+Lxy4giwwR5LJQTANkqe4w/d9u129bRhTu/SUzSUIr65zZ/s6TU\n" +
        "GQD6QzKY1Y8xS+FoQQIDAQAB\n" +
        "-----END PUBLIC KEY-----";

    var encrypt = new JSEncrypt();
    encrypt.setPublicKey(PUBLIC_KEY);

    var openvideoindex = 0
    var videourl = new Array(10)
    var zbrtmp = new Array(10)
    var zbxy = new Array(10)


    function checktoken(urlok,  urlfail){
        var oldtitle = document.title
        $.ajax(
            {
                //几个参数需要注意一下
                type: "Get",//方法类型
                url: urlok ,//url
                contentType: "application/text; charset=utf-8",
                data:  {},
                beforeSend: function(request){
                    request.setRequestHeader("token", $.cookie('token'));
                },

                success: function (result) {
                    document.close()

                    document.write(result)
                    var url = window.location.href
                    var prex = url.replace(oldtitle, "")
                    history.pushState(null, null, prex + document.title)
                    history.replaceState(
                        null, null, prex + document.title
                    )
                    //window.location.href = window.location.host + "/" + document.title
                    // if (result.success != 1)
                    // {
                    //     window.location.href = urlfail
                    // }
                    // else
                    // {
                    //     window.location.href = urlok
                    // }
                },
                error : function() {
                    alert("异常！");
                }
            }
        )
    }

    function checktokenOpen(urlok,  urlfail){

        $.ajax(
            {
                //几个参数需要注意一下
                type: "Get",//方法类型
                url: "./checkToken" ,//url
                contentType: "application/json",
                data:  {},
                beforeSend: function(request){
                    request.setRequestHeader("token", $.cookie('token'));
                },

                success: function (result) {

                    if (result.success != 1)
                    {
                        window.open(urlfail)
                    }
                    else
                    {
                        window.open(urlok)
                    }
                },
                error : function() {
                    alert("异常！");
                }
            }
        )
    }

